package hhh.app.presenter.ui.base;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import butterknife.ButterKnife;

/**
 * Created by hhh on 2016/12/22.
 */
public abstract class BaseFragment extends Fragment {
//    protected StateLayout rootView;
//    private int[] ids={R.id.state_empty,R.id.state_error,R.id.state_loading};

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
//        rootView=new StateLayout(getContext(),getFragmentLayoutId());
//        rootView.setContentView(getFragmentLayoutId());
        View view=inflater.inflate(getFragmentLayoutId(),container,false);
        ButterKnife.bind(this,view);
        init();
        return view;
    }

    protected abstract void init();

    protected abstract int getFragmentLayoutId();
}
